package thesis.database;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.sql.DataSource;

public interface CustomerDAO {
	/**
	 * This is the method to be used to initialize database resources ie.
	 * connection.
	 */
	public void setDataSource(DataSource ds);

	/**
	 * This is the method to be used to create a record in the Customer table.
	 */
	public void create(Customer cus);

	public int createAndReturnId(Customer cus);

	/**
	 * This is the method to be used to list down a record from the Customer
	 * table corresponding to a passed Customer id.
	 */
	public Customer getCustomer(Integer id);

	/**
	 * This is the method to be used to list down all the records from the
	 * Customer table.
	 */
	public List<Customer> listCustomers();

	/**
	 * This is the method to be used to delete a record from the Customer table
	 * corresponding to a passed Customer id.
	 */
	public void delete(Integer id);

	/**
	 * This is the method to be used to update a record into the Customer table.
	 */
	public int update(Customer cus);

	/**
	 * This is the method to be used to list all phone number of customer.
	 */
	public ArrayList<String> listPhoneNumbers(int id);

	/**
	 * This is the method to be used to get customer by phoneNumber.
	 */
	public Customer getCustomerByPhoneNumber(String phoneNumber);

	/**
	 * This is the method to be used to get addresses by id.
	 */
	public ArrayList<String> getAddressesById(int id);
	
	public List<Customer> getCusApproNumber(String phone);

}
